package edu.jd.movieplatform.c_admin.movie.dao;

import edu.jd.movieplatform.c_admin.movie.Screen;
import edu.jd.movieplatform.c_admin.movie.ScreenDto;
import edu.jd.movieplatform.c_admin.movie.UpdDto;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @descriptions:
 * @data: 2021/7/16 17:12
 */
public interface C_adminScreenDao {
    List<Screen> findScreenList(ScreenDto dto);

    void insertScreen(ScreenDto dto);

    List<Integer> findCinemaHallIdByName(String name);
    @Select("select mov_id from movie where mov_name=#{mov_name}")
    Integer getMovidByMovName(String mov_name);
    @Select("select cnm_id from cinema where cnm_name=#{cnm_name}")
    Integer getCnmIdByCnmName(String cnm_name);
    @Update("update screen set mov_id = #{mov_id},cnm_hall_id = #{cnm_hall_id},screen_time= #{screen_time},price= #{price} where screen_id = #{screen_id}")
    void updScreen(UpdDto dto);
    @Delete("delete from screen where screen_id=#{id}")
    void delScreen(Integer id);
}
